module.exports = function(app) {

    var isLoggedIn = require('../app/util/authUtil').isLoggedIn;
    var selectController = require('../app/controller/selectController');

    var routes_get = ['getUpgradeProjects', 'getTestStatus', 'getDevelopers', 'getSvnUser'];
    var routes_post = [];

    for (var i = 0; i < routes_get.length; i++) {
        (function(_routeName) {
            app.get('/select/' + _routeName, isLoggedIn);
            app.get('/select/' + _routeName, function(req, res) {
                selectController[_routeName](req, res);
            });
        }(routes_get[i]));
    }

    for (var i = 0; i < routes_post.length; i++) {
        (function(_routeName) {
            app.post('/select/' + _routeName, isLoggedIn);
            app.post('/select/' + _routeName, function(req, res) {
                selectController[_routeName](req, res);
            });
        }(routes_post[i]));
    }

}